<template>
	<view>
		list
		<!-- <image  src='../../static/img/Screenshot 2024-06-23 111946.png' mode=""></image> -->
		<image :src="img_name" mode="" @click="preview()"></image>
		<button @click="chooseImage">btn</button>
		{{ $store.username }}
		
	</view>
</template>

<script>
	// import store from '@/store/store.js'
	import {mapState} from 'vuex'
	
	export default {
		data() {
			return {
				img_name: '',
		

			}
		},
		computed:{
			...mapState(['username'])
		},
		onLoad() {
			// console.log(this.username);
			console.log(this.$store.state.username);
		// console.log(store.state.username);
		},
		methods: {
			preview(){
					uni.previewImage({
						urls :[this.img_name]
					})
			},
			
			async chooseImage() {
				await uni.chooseImage({
					success: (res) => {
						this.img_name = '../../static/img/' + res.tempFiles[0].name
						console.log(this.img_name);
						// console.log(res.tempFiles[0].name);
					}
				})
				console.log(this.img_name);
			}
		},
		onReachButtom() {
			console.log('onReachButtom');
		}
	}
</script>

<style>

</style>